﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using MethodIT.Helper;
using MyGeneration.dOOdads;

using Hr20.DAL;
using Hr20.BLL;
using Hr20.ProcessFlow;

namespace Appraisal.Web.Admin
{
    public partial class UmpAdmin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Bind();
            }
        }

        private void Bind()
        {
            ZB_Ump b = new ZB_Ump();
            b.Query.AddOrderBy(ZB_Ump.ColumnNames.Name, WhereParameter.Dir.ASC);
            b.LoadAll();
            dg.DataSource = b.DefaultView;
            dg.DataBind();
        }

        protected void lbtnNew_Click(object sender, EventArgs e)
        {
            HelperURL.Redirect("NewUmp.aspx");
        }

        protected void dg_EditCommand(object source, DataGridCommandEventArgs e)
        {
            int id = HelperDigit.ConvertToInt32(e.Item.Cells[0].Text);
            HelperURL.Redirect("NewUmp.aspx?ID=" + id.ToString());
        }
    }
}
